<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>
	<canvas id="canvas" width="500" height="500" style="border:1px solid #000"></canvas>

</body>
</html>

<script type="text/javascript">

	var canvas = document.getElementById('canvas');
	var context = canvas.getContext('2d');
	//下面是画矩形!!!矩形和矩形框不同//
	context.fillRect(50,50,200,100);
	//下面是旋转矩形//
	context.rotate(30*Math.PI/180);
	context.fillStyle ='red'
	context.fillRect(50,50,200,100);
	//沿着左顶点坐标系旋转//

</script>